﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using LayuiDemo.Models;


namespace LayuiDemo.ViewModels.PostVMs
{
    public partial class PostTemplateVM : BaseTemplateVM
    {
        public ExcelPropety Title_Excel = ExcelPropety.CreateProperty<Post>(x => x.Title);
        public ExcelPropety Content_Excel = ExcelPropety.CreateProperty<Post>(x => x.Content);
        public ExcelPropety Blog_Excel = ExcelPropety.CreateProperty<Post>(x => x.BlogId);

	    protected override void InitVM()
        {
            Blog_Excel.DataType = ColumnDataType.ComboBox;
            Blog_Excel.ListItems = DC.Set<Blog>().GetSelectListItems(Wtm, y => y.Url);
        }

    }

    public class PostImportVM : BaseImportVM<PostTemplateVM, Post>
    {

    }

}
